package top.goldenyear.porpoise.common.core.model;

import lombok.Setter;

/**
 * EnumOption 将enum数据转为java bean
 *
 * @author airhead
 */
@Setter
public class EnumOption implements Option {
  private String name;
  private Object value;

  public EnumOption(String name, Object value) {
    this.name = name;
    this.value = value;
  }

  @Override
  public String getName() {
    return name;
  }

  @Override
  public Object getValue() {
    return value;
  }

  @SuppressWarnings("unchecked")
  public <T> T valueAs() {
    return (T) value;
  }
}
